package com.example.demo2.entity;

import lombok.Getter;
import lombok.Setter;

/**
 * Description:
 *
 * @author liuziyang
 * @date 2021/6/30 14:40
 */
@Setter
@Getter
public class RespBean {
    private Integer status;
    private String msg;
    private Object obj;

    public static RespBean ok(String msg, Object data) {
        RespBean bean = new RespBean();
        bean.setStatus(200);
        bean.setMsg(msg);
        bean.setObj(data);
        return bean;
    }

    public static RespBean error(String msg) {
        RespBean bean = new RespBean();
        bean.setStatus(404);
        bean.setMsg(msg);
        return bean;
    }
}
